<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  
  <head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
 	<link rel="stylesheet" href="../static/css/back/font.css">
 	<link rel="stylesheet" href="../static/css/back/role.css">
    <link rel="stylesheet" href="../static/css/back/xadmin.css">
    <script type="text/javascript" src="../static/js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="../static/js/layui/layui.js"
	charset="utf-8"></script>
<script type="text/javascript" src="../static/js/back/xadmin.js"></script>
<!--     <script type="text/javascript" src="../static/js/back/xadmin.js"></script> -->
    <script type="text/javascript" src="../static/js/back/ajax.js"></script>
<!--     <script type="text/javascript" src="../static/js/back/shop-info.js"></script> -->
    <style type="text/css">
.layui-upload-drag.pre{
	padding: 5px !important;
}
.layui-upload-drag.pre img{
	width:120px;
	height: 120px;
}
.layui-upload-drag+p{
	margin-top: 10px;
}
.layui-upload-list {
	text-align: -webkit-center;
}

.layui-upload {
	margin-left: 150px;
}
</style>
  </head>
  
  <body>
  <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="javascript:;">首页</a>
        <a href="javascript:;">门店管理</a>
        <a href="javascript:;"><cite>新增门店</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="iconfont icon-refresh right-top-ref" ></i></a>
    </div>
    <div class="x-body">
        <form class="layui-form"  onsubmit="javascript:return false;">
        <input type="hidden" id="paramKey" name="id" /> 
        <input type="hidden" id="shopUserId" name="shopUserId" /> 
        
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		  <legend>填写信息</legend>
		</fieldset>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                 门店电话
              </label>
              <div class="layui-input-block">
                  <input type="text" id="shopphone" name="addressInfo" 
                  autocomplete="off" th:value="${shop.userContact}" class="layui-input" placeholder="请输入门店电话">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                 门店公告
              </label>
              <div class="layui-input-block">
                   <textarea placeholder="请输入门店公告" th:text="${shop.shopNotice}"  id="gonggao" name="mark" class="layui-textarea"></textarea>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">起送价
              </label>
              <div class="layui-input-block">
                   <input type="text" id="sendprice" name="addressInfo"  lay-verify="number"
                  autocomplete="off" class="layui-input" value="0" th:value=" ${#numbers.formatDecimal(shop.shopSendMinprice/100.0,1,2)}" placeholder="请填写起送价，单位元 ">
              </div>
          </div>
          <label for="username" class="layui-form-label"></label>
          <button  class="layui-btn" onclick="saveSopInfo()">保存</button>
          <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		  <legend>门店二维码</legend>
		  <div class="layui-form-item">
		          <div class="layui-inline">
		              <label for="phone" class="layui-form-label">
		              </label>
		              <input type="hidden" name="shopLogo" />
							<div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre ">
										    <img class="shop-logo" src="" th:src="${shop.shopQrcode}" id="shop-logo-pre">
										  </div>
										 <p id="shop-logo-info-p"></p>
									</div>
								</div>
							</div>
						</div>
          </div>
		</fieldset>
    	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
		  <legend>门店信息</legend>
		</fieldset>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>门店名称
              </label>
              <div class="layui-input-inline">
                 <p  class="layui-form-mid" th:text="${shop.shopTitle}"></p>
              </div>
          </div>
          <div class="layui-form-item" id="x-city">
            <label class="layui-form-label"><span class="x-red">*</span>门店区域</label>
            <div class="layui-input-inline">
            	<p  class="layui-form-mid" th:text="${shop.addressProvince}+${shop.addressCity}+${shop.addressArea}"></p>
            </div>
          </div>
          <div class="layui-form-item">
              <label for="" class="layui-form-label">
                  <span class="x-red">*</span>详细地址
              </label>
              <div class="layui-input-inline">
                <p  class="layui-form-mid" th:text="${shop.addressInfo}"></p>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  坐标定位 
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.addressLocation}"></p>
              </div>
<!--                <button class="layui-btn" lay-filter="" >地图定位</button> -->
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  <span class="x-red">*</span>门店类型
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.shopType==1?'美食':'超市'}"></p>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  <span class="x-red">*</span>到期时间
              </label>
              <div class="layui-inline">
		      <div class="layui-input-inline">
		        <p  class="layui-form-mid" th:text="${#dates.format(shop.serverEndTime, 'yyyy-MM-dd')}"></p>
		      </div>
		    </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  入驻费用
              </label>
              <div class="layui-input-inline">
                 <p  class="layui-form-mid" th:text="${ shop.shopInCharge ==0 ?'0': #numbers.formatDecimal(shop.shopInCharge / 100,0,2)}+'元'"></p>
              </div>
 	          </div>
          <div class="layui-form-item">
		          <div class="layui-inline">
		              <label for="phone" class="layui-form-label">
		                <span class="x-red">*</span> 门店logo
		              </label>
		              <input type="hidden" name="shopLogo" />
							<div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre ">
										    <img class="shop-logo" src="" th:src="${shop.shopLogo}" id="shop-logo-pre">
										  </div>
										 <p id="shop-logo-info-p"></p>
									</div>
								</div>
							</div>
						</div>
					  <div class="layui-inline">
						  <label for="phone" class="layui-form-label">
			                <span class="x-red">*</span> 营业执照
			              </label> 
			               <input type="hidden" name="shopLicense" />
			              <div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre">
										    <img class="shop-srct" th:src="${shop.shopLicense}" id="shop-srct-pre">
										  </div>
										 <p id="shop-srct-info-p"></p>
									</div>
								</div>
							</div>
		          </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  <span class="x-red">*</span>姓名
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.userName}"></p>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  <span class="x-red">*</span>联系方式
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.userContact}"></p>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="phone" class="layui-form-label">
                  <span class="x-red">*</span>身份证号
              </label>
              <div class="layui-input-inline">
                 <p  class="layui-form-mid" th:text="${shop.userIdCard}"></p>
              </div>
          </div>
          <div class="layui-form-item">
		          <div class="layui-inline">
		              <label for="phone" class="layui-form-label">
		                <span class="x-red">*</span> 手持身份证正面
		              </label>
		              <input type="hidden" name="userCardFront" />
							<div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre">
										    <img class="shop-idc" th:src="${shop.userCardFront}" id="shop-idc-pre">
										  </div>
										 <p id="shop-idc-info-p"></p>
									</div>
								</div>
							</div>
						</div>
					  <div class="layui-inline">
						  <label for="phone" class="layui-form-label">
			                <span class="x-red">*</span> 卫生许可证
			              </label> 
			              <input type="hidden" name="userCardBack" />
			              <div class="layui-upload">
								<div class="layui-upload-list">
									<div id="shop-logo-info">
										<div class="layui-upload-drag pre ">
										    <img class="shop-idb" th:src="${shop.userCardBack}" id="shop-idb-pre">
										  </div>
										 <p id="shop-idb-info-p"></p>
									</div>
								</div>
							</div>
					  </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  微信
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.userWxName}"></p>
              </div>
          </div>
          <!-- <div class="layui-form-item">
              <label for="userWx" class="layui-form-label">
                  微信
              </label>
              <div class="layui-input-inline">
                  <p  class="layui-form-mid" th:text="${shop.userWx}"></p>
              </div>
          </div> -->
      </form>
    </div>
    <script>
    layui.use([ 'form', 'layer'],function() {
    	layer = layui.layer;
    })
    function saveSopInfo(){
    	var pr = $("#sendprice").val();
    	var go = $("#gonggao").val();
    	var ph = $("#shopphone").val();
    	var map = {};
    	if(pr){
    		map['shopSendMinprice'] = (pr*100).toFixed(0);
    	}
    	if(go){
    		map['shopNotice'] = go;
    	}
    	if(ph){
    		map['userContact'] = ph;
    	}
    	if(!pr&&!ph&&!go){
    		return;
    	}
//     	map['id'] ='18ydg';
    	map['id'] = getCookie('shop_id');
    	_ajax_post_token('../shop/updateShopByIdperv',map,function(res){
    		 if(res.resultCode == 1000){
    			 layer.msg('保存成功',{icon:6,time:2000});
    		 }else{
    			 layer.msg('保存失败',{icon:5,time:2000});
    		 }
    	})
    }
    </script>
  </body>
</html>